

<!DOCTYPE html>
<html lang="zh" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/walker_sue/img/favicon.png">
  <link rel="icon" type="image/png" href="/walker_sue/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="lk">
  <meta name="keywords" content="">
  <title>逻辑回归与评分卡模型评价标准 - Walker_Sue</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/walker_sue/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/github-gist.min.css" />
    
  

  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/walker_sue/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/walker_sue/js/utils.js" ></script>
  <script  src="/walker_sue/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.3.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/walker_sue/">&nbsp;<strong>Walker</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/">
                <i class="iconfont icon-home-fill"></i>
                主页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="iconfont icon-books"></i>
                文档
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/">
                    
                    主题博客
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/docs/guide/">
                    
                    配置指南
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/docs/icon/">
                    
                    图标用法
                  </a>
                
              </div>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner intro-2" id="background" parallax=true
         style="background: url('/walker_sue/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container page-header text-center fade-in-up">
    <span class="h2" id="subtitle">
    
</span>




<div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-05-20 13:49" pubdate>
        May 20, 2021 pm
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      781 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      8
       分钟
    </span>
  

  
  
</div>


</div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto" id="post">
            <!-- SEO header -->
            <h1 style="display: none">逻辑回归与评分卡模型评价标准</h1>
            
            <div class="markdown-body" id="post-body">
              <div align='center' ><font size='10'>机器学习-BI</font></div>

<hr>
<div align='center' ><font size='5'>Week_12</font></div>
<div align='center' ><font size='5'>逻辑回归与评分卡模型评价标准</font></div>

<hr>
<h2 id="逻辑回归与评分卡模型评价标准"><a href="#逻辑回归与评分卡模型评价标准" class="headerlink" title="逻辑回归与评分卡模型评价标准"></a>逻辑回归与评分卡模型评价标准</h2><h3 id="1-逻辑回归"><a href="#1-逻辑回归" class="headerlink" title="1.逻辑回归"></a>1.逻辑回归</h3><blockquote>
<p>逻辑回归假设数据服从伯努利分布，通过极大似然函数的方法，运用梯度下降来求解参数，来达到将数据二分类的目的。<br></p>
</blockquote>
<p><img src="lr01.png" srcset="/walker_sue/img/loading.gif"><br><img src="lr02.png" srcset="/walker_sue/img/loading.gif"><br><img src="lr03.png" srcset="/walker_sue/img/loading.gif"></p>
<h3 id="2-评分卡评价标准"><a href="#2-评分卡评价标准" class="headerlink" title="2.评分卡评价标准"></a>2.评分卡评价标准</h3><p><strong>2.1 评分卡模型的制作步骤</strong> <br><br><img src="score_card00.png" srcset="/walker_sue/img/loading.gif"></p>
<ul>
<li>数据预处理</li>
<li>变量衍生构造</li>
<li>变量分箱</li>
<li>变量挑选</li>
<li>模型参数估计</li>
<li>模型校验</li>
<li>概率转换为分数</li>
</ul>
<p><img src="score_card01.png" srcset="/walker_sue/img/loading.gif"><br><img src="score_card02.png" srcset="/walker_sue/img/loading.gif"><br><img src="score_card03.png" srcset="/walker_sue/img/loading.gif"><br><img src="score_card04.png" srcset="/walker_sue/img/loading.gif"></p>
<p><strong>2.2 模型的评价标准</strong> <br></p>
<p><strong>模型的区分度</strong><br></p>
<p>评分卡模型的结果需要能对好、坏人群给出一定的区分度，常用方法（在申请评分卡一般使用KS来检验区分度即可，Divergence和Gini仅作为知识扩展）<br><br><img src="ks01.png" srcset="/walker_sue/img/loading.gif"></p>
<ul>
<li>KS（最常用的指标，因为有经验值可以参考），越高越好<br></li>
</ul>
<p><img src="ks02.png" srcset="/walker_sue/img/loading.gif"><br><img src="ks03.png" srcset="/walker_sue/img/loading.gif"></p>
<ul>
<li>Divergence（无经验值可以参考，应用场景可以是在两个评分卡模型选择时，可以比较两个评分卡模型的优劣），越高越好 <br></li>
</ul>
<p><img src="divergence.png" srcset="/walker_sue/img/loading.gif"></p>
<ul>
<li>Gini（没有KS用的广，可以用来对比选择评分卡和Divergence用途差不多，多个评分卡选一个），越小越好 <br></li>
</ul>
<p><img src="gini.png" srcset="/walker_sue/img/loading.gif"></p>
<p><strong>模型的准确度</strong> <br></p>
<p>评价模型的准确度，会想到正确率来评估，但是在评分卡的准确度来说是不可通的，错误代价不一样，所以不能简单使用正确率，可以看下面的例子: <br></p>
<p><img src="auc00.png" srcset="/walker_sue/img/loading.gif"></p>
<p>所以，我们要考虑使用其它指标（AUC），在介绍AUC之前，我们先来了解一下混淆矩阵<br></p>
<p><img src="auc01.png" srcset="/walker_sue/img/loading.gif"></p>
<p>通过混淆矩阵，我们可以算出<br></p>
<p><img src="auc02.png" srcset="/walker_sue/img/loading.gif"><br>横轴：FPR（FPR = FP/(FP+TN)） <br></p>
<p>纵轴：TPR（TPR = TP/(TP+FN)）<br></p>
<p>实际上这两个指标分母都是定值，ROC曲线就是不断改变阈值得到不同的点（FPR，TPR），绘制在坐标轴上就得到ROC曲线<br><br><img src="auc03.png" srcset="/walker_sue/img/loading.gif"><br><img src="auc04.png" srcset="/walker_sue/img/loading.gif"><br>理想模型：好人全部预测成好的，坏人全部预测成坏的（0,0）–&gt;（0,1）–&gt;(1,1) <br><br><img src="auc05.png" srcset="/walker_sue/img/loading.gif"><br>随机模型：类似于抛硬币，这种情况是模型最差的情况 <br><br><img src="auc06.png" srcset="/walker_sue/img/loading.gif"><br>衡量模型准确度的指标AUC是由ROC曲线衍生出来的，AUC可以判断模型的预测能力 <br><br><img src="auc07.png" srcset="/walker_sue/img/loading.gif"><br><img src="auc08.png" srcset="/walker_sue/img/loading.gif"><br><img src="auc09.png" srcset="/walker_sue/img/loading.gif"></p>
<p><strong>模型的稳定性</strong><br></p>
<ul>
<li>对数据的量和数据时间跨度有要求，使用PSI指标，一般要求PSI&lt;25%，PSI越小越好 <br></li>
</ul>
<p>模型的稳定性只和样本分数有关，不需要标签不需要表现期,一般模型的稳定性主要为两个方面： <br></p>
<ul>
<li>在经济比较平稳的时期，使用阶段时候的稳定性</li>
<li>使用训练集训练出来的模型要有泛化性，不能用测试集去测试模型很不稳定</li>
</ul>
<p>指标PSI的介绍： <br><br><img src="psi01.png" srcset="/walker_sue/img/loading.gif"></p>
<p>评分卡模型概率转换为分数</p>
<p>Base Point主要的意义是是的分数为正，没有实际意义,根据业务内容制定：<br><br><img src="psi02.png" srcset="/walker_sue/img/loading.gif"><br><img src="psi03.png" srcset="/walker_sue/img/loading.gif"></p>
<br>

<h3 id="学习资料"><a href="#学习资料" class="headerlink" title="学习资料"></a>学习资料</h3><ul>
<li>1.<a target="_blank" rel="noopener" href="https://blog.csdn.net/LuYi_WeiLin/article/details/87449386">评分卡模型的评价标准</a></li>
<li>2.<a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/103459570">逻辑回归的本质及损失函数的推导、求解</a></li>
</ul>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/walker_sue/categories/%E9%A3%8E%E6%8E%A7%E6%A8%A1%E5%9E%8B/">风控模型</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/categories/%E9%A3%8E%E6%8E%A7%E6%A8%A1%E5%9E%8B/%E8%AF%84%E4%BB%B7%E6%A0%87%E5%87%86/">评价标准</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/BI/">BI</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/%E9%A3%8E%E6%8E%A7%E6%A8%A1%E5%9E%8B/">风控模型</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/%E8%AF%84%E5%88%86%E5%8D%A1%E6%A8%A1%E5%9E%8B/">评分卡模型</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/LR/">LR</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！</p>
              
              
                <div class="post-prevnext row">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/walker_sue/2021/05/27/week13-NP1/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">常见规划问题（一）</span>
                        <span class="visible-mobile">Vorheriger</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/walker_sue/2021/05/14/week11-risk/">
                        <span class="hidden-mobile">评分卡模型</span>
                        <span class="visible-mobile">Nächster</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;TOC</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Suchen</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">Stichwort</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/walker_sue/js/debouncer.js" ></script>
<script  src="/walker_sue/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/walker_sue/js/lazyload.js" ></script>
  



  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/walker_sue/js/clipboard-use.js" ></script>







  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: '#post-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    function typing(id, title){
        var typed = new Typed('#' + id, {
            strings: [
              '  ',
              title + "&nbsp;",
            ],
            cursorChar: "_",
            typeSpeed: 70,
            loop: false,
        });
        typed.stop();
        $(document).ready(function () {
            $(".typed-cursor").addClass("h2");
            typed.start();
        });
    }
    
        typing("subtitle", "逻辑回归与评分卡模型评价标准")
    
  </script>


  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/walker_sue/js/local-search.js" ></script>
  <script>
    var path = "/walker_sue/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>





  

  
    <!-- MathJax -->
    <script>
      MathJax = {
        tex: {
          inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        options: {
          renderActions: {
            findScript: [10, doc => {
              document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
                const display = !!node.type.match(/; *mode=display/);
                const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                const text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = { node: text, delim: '', n: 0 };
                math.end = { node: text, delim: '', n: 0 };
                doc.math.push(math);
              });
            }, '', false],
            insertedScript: [200, () => {
              document.querySelectorAll('mjx-container').forEach(node => {
                let target = node.parentNode;
                if (target.nodeName.toLowerCase() === 'li') {
                  target.parentNode.classList.add('has-jax');
                }
              });
            }, '', false]
          }
        }
      };
    </script>

    <script async src="https://cdn.staticfile.org/mathjax/3.0.5/es5/tex-svg.js" ></script>

  











</body>
</html>
